#打包
FROM node:22.6-alpine as build
WORKDIR /app
COPY . .
RUN npm config set registry https://registry.npmmirror.com
RUN npm install
RUN npm run build:prod

#运行环境
FROM nginx as base
COPY --from=build /app/dist /usr/share/nginx/html